package book_management.operation.impl;

import book_management.book.BookList;
import book_management.operation.IOperation;

public class BorrowOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("您现在进行的是借书操作~");
        System.out.println("请输入您想借的书名:");
        String booksName = scanner.next();
        // 判断这个书是否存在
        if (bookList.isContains(booksName)) {
            // 进行具体的借书操作
            bookList.borrowBook(booksName);
            System.out.println("借书成功~");
        }else {
            System.err.println("该书籍还没上架，客官再等等~~");
        }
    }
}
